<?php
	class phuluchopdongbs
	{
		// Các trường
		public $MaPhuLuc = ""; // auto_increment
		public $SoKheUoc = "";
		public $NgayTra = 0;
		public $SoTienTraGoc = 0;
		public $SoTienTraLai = 0;
		public $DuNoTrongHan = 0;
		public $SoTienQuaHan = "";
		public $NgayTraQuaHan = "";
		public $SoTienTraGocQH = "";
		public $SoTienTraLaiQH = 0;
		public $DuNoQuaHan = "";
		public $Khoa = 0;
		// Các phương thức
		public function Them()
		{
			$db = new phuluchopdongdb();
			return $db->Them(
							 $this->MaPhuLuc, 
						     $this->SoKheUoc,
							 $this->NgayTra,
						     $this->SoTienTraGoc,
						     $this->SoTienTraLai,
						     $this->DuNoTrongHan,
						     $this->SoTienQuaHan, 
							 $this->NgayTraQuaHan,
							 $this->SoTienTraGocQH,
							 $this->SoTienTraLaiQH,
							 $this->DuNoQuaHan,
							 $this->Khoa);
		}
		public function ThemSoTietKiem()
		{
			$db = new phuluchopdongdb();
			return $db->ThemSoTietKiem(
					$this->MaPhuLuc,
					$this->SoKheUoc,
					$this->NgayTra,
					$this->SoTienTraGoc,
					$this->SoTienTraLai,
					$this->DuNoTrongHan,
					$this->SoTienQuaHan,
					$this->NgayTraQuaHan,
					$this->SoTienTraGocQH,
					$this->SoDuKyHanTT,
					$this->SoTienNhan);
		}
		public function CapNhat()
		{
			$db = new phuluchopdongdb();
			return $db->CapNhat($this->MaPhuLuc, 
						     	$this->SoKheUoc,
							 	$this->NgayTra,
						     	$this->SoTienTraGoc,
						     	$this->SoTienTraLai,
						     	$this->DuNoTrongHan,
						     	$this->SoTienQuaHan, 
								$this->NgayTraQuaHan,
							 	$this->SoTienTraGocQH,
							 	$this->SoTienTraLaiQH,
							 	$this->DuNoQuaHan,
							 	$this->Khoa);
		}
		
		public function CapNhatKhoa()
		{
			$db = new phuluchopdongdb();
			return $db->CapNhatKhoa($this->MaPhuLuc,
									$this->Khoa);
		}
		
		public function LayDanhSach()
		{
			$db = new phuluchopdongdb();
			return $db->LayDanhSach($this->MaPhuLuc, 
						     		$this->SoKheUoc,
							 		$this->NgayTra,
						     		$this->SoTienTraGoc,
						     		$this->SoTienTraLai,
						     		$this->DuNoTrongHan,
						     		$this->SoTienQuaHan, 
									$this->NgayTraQuaHan,
							 		$this->SoTienTraGocQH,
							 		$this->SoTienTraLaiQH,
							 		$this->DuNoQuaHan,
							 		$this->Khoa	
							 		);
		}
		
	}
?>